import { RootState } from "../store";
import {createSlice} from "@reduxjs/toolkit";

export const avatarInitialState = '/pic/pyy.jfif'


const avatarSlice = createSlice({
    name: 'avatarPic',
    initialState: avatarInitialState,
    reducers: {
        saveAvatar: (state, action) => {
            return action.payload
        },
        reInitAvatar: (state, action) => action.payload,
    }
})

export default avatarSlice.reducer;

export const getAvatar = (state: RootState) => state.avatar

export const { saveAvatar, reInitAvatar } = avatarSlice.actions
